/**
 * 
 */
package net.dfrz.java1305.team4.service;

import java.util.List;

import net.dfrz.java1305.team4.dao.CategoryDao;
import net.dfrz.java1305.team4.dao.CategoryDaoJDBCImpl;
import net.dfrz.java1305.team4.domain.Category;

/**
 * @author acer
 *
 */
public class CategoryServiceImpl implements CategoryService{

	private CategoryDao categoryDao=new CategoryDaoJDBCImpl();
	
	@Override
	public void addCategory(Category category) {
		
		this.categoryDao.addCategory(category);
		
	}

	@Override
	public List<Category> loadAll() {
		
		return this.categoryDao.loadAll();
	}

	@Override
	public Category getCategoryById(Integer categoryId) {
		
		return this.categoryDao.getCategoryById(categoryId);
	}

	@Override
	public void removeCategory(Integer categoryId) {
		
		this.categoryDao.deleteCategory(categoryId);
	}

	@Override
	public void modifyCategory(Category category) {
		
		this.categoryDao.updateCategory(category);
	}
	
}
